<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="/static/assets/css/layui.css" media="all">
    <title>收费订单详情</title>
</head>
<body>
<table id="order" lay-filter="test" style="margin-top: -10px"></table>
<script src="/static/assets/layui.all.js" charset="utf-8"></script>
<script src="/static/assets/jquery.min.js"></script>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">解除绑定</a>
</script>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="getCheckData">删除选中行</button>
    </div>
</script>
</body>
</html>
<script>
    $(function () {
        layui.use('table', function () {
            var table = layui.table;
            table.render({
                elem: '#order'
                , url: '/tOrder/selectByPage' //数据接口
                , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                    title: '提示'
                    , layEvent: 'LAYTABLE_TIPS'
                    , icon: 'layui-icon-tips'
                }]
                , method: 'post'
                , title: '用户数据表'
                , cols: [
                    [ //表头
                        {type: 'checkbox', fixed: 'left'}
                        , {field: 'parkPlaceId', title: 'ID', sort: true}
                        , {field: 'parkPlaceNum', title: '车位号', sort: true}
                        , {field: 'isEmploy', title: '是否空闲'}
                        , {field: 'desc', title: '车位类型'}
                        , {field: 'carNum', title: '车牌号'}
                        , {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 200}
                    ]
                ]
                , response: {
                    statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                }
                , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.message, //解析提示文本
                        "count": res.count, //解析数据长度
                        "data": res.data.parkPlaces//解析数据列表
                    };
                }
                , page: true //开启分页
                , id: "parkPlaceList"
            });
        })
    })
</script>